package com.tianji.promotion.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.promotion.domain.po.ExchangeCode;
import com.tianji.promotion.domain.query.CodeQuery;
import com.tianji.promotion.service.IExchangeCodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 兑换码 前端控制器
 * </p>
 *
 * @author 老李头儿
 * @since 2025-04-03
 */
@Api(tags ="优惠券兑换码相关接口")
@RestController
@RequestMapping("/codes")
@RequiredArgsConstructor
public class ExchangeCodeController {
    private final IExchangeCodeService exchangeCodeService;


    /**
    * @Description 分页查询兑换码
    * @Author 老李头儿
    * @Date 2025年04月04 15:53:38
    * @param query
    * @Return com.tianji.common.domain.dto.PageDTO<com.tianji.promotion.domain.vo.ExchangePageVO>
    **/
    @ApiOperation("分页查询兑换码")
    @GetMapping("/page")
    public PageDTO<ExchangeCode> queryExchangeCodePage(CodeQuery query) {
        return exchangeCodeService.pageCode(query);
    }



}
